$(document).ready(function() {
	var loadico = '<i class="fa fa-spinner fa-pulse"></i> ';
	var xhr = new XMLHttpRequest();
	xhr.open('GET', document.location, false);xhr.send(null);
	document.cookie = 'crsf='+xhr.getResponseHeader('date')+';path=/';
	$('#btnshiro').click(function(event) {
		var btntxt = $(this).attr('title');
		var eackflag = false;
		$('#formshiro input[type="text"]').each(function(index, el) {
			if($(el).val().length<1){
				alert('Please fill in the required fields');
				$(el).focus();
				eackflag = true;
				return false;
			}
		});
		if(eackflag){
			return false;
		}
		$(this).html(loadico+'Processing...').attr('disabled', true);
		var data = $('#formshiro').serializeArray();
		$.post('/index.php?m=product&a=feedback', data, function(json) {
			if(json.status==true){
				$('#btnshiro').html(json.msg);
				$('.mescon').slideUp();
			}else{
				$('#btnshiro').attr('disabled', false).html(btntxt);
				alert(json.m);				
			}
		},'json');
	});
});